FROM alpine:3.19
LABEL MAINTAINER="linweile<674969619@qq.com>"

ARG DEBIAN_FRONTEND=noninteractive
# 取消命令行交互

USER root
# 切换用户
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories

RUN apk update

#切换中国时间
RUN apk add tzdata
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN  echo "Asia/Shanghai" > /etc/timezone
#------

# 需要编译安装的php
RUN apk add gcc
RUN apk add make
RUN apk add pkgconf
RUN apk add libxml2-dev
RUN apk add sqlite-dev
RUN apk add oniguruma-dev
RUN apk add curl-dev
RUN apk add openssl-dev
RUN apk add libzip-dev
RUN apk add zlib-dev
RUN apk add libpng-dev
RUN apk add build-base
#
#通过php-fpm 访问时带的系统角色
RUN adduser -D -s /bin/sh www


# 安装php
ADD ./zip/php-8.3.6.tar.gz /

RUN cd /php-8.3.6 && ./configure --prefix=/usr/local --enable-fpm  -with-fpm-user=www -with-fpm-group  --with-pear  --enable-gd --enable-mbstring --with-curl --with-pdo-mysql --with-openssl --with-zip

RUN cd /php-8.3.6 && make && make install
#

# ------------  /usr/bin/php-config8.2
# RUN echo no | pecl install redis
# 编译安装php-redis拓展

# ------------
# RUN  apk add libmemcached-dev
# RUN  apk add zlib-dev
# RUN  echo no | pecl install memcached
# 安装memcached拓展和所需的环境


# RUN  pecl install mongodb

#  编译安装mongodb拓展


# ------------
RUN  apk add unzip
#  安装unzip 避免composer警告

# ------------
RUN  apk add unzip
#  安装unzip 避免composer警告


#------------
# RUN apk add nodejs npm
#  安装nodejs

#------------
RUN apk add supervisor
#  安装supervisor

#php.ini文件 php拓展
COPY  ./volumes/php-cli/php.ini  /usr/local/lib/php.ini
#
COPY  ./volumes/php-fpm/php-fpm.conf  /usr/local/etc/php-fpm.conf
COPY  ./volumes/php-fpm/www.conf  /usr/local/etc/php-fpm.d/www.conf









